<?php
/**
 * Created by PhpStorm.
 * User: 小灰灰
 * Date: 2022-06-23
 * Time: 11:13:40
 * Info:
 */

namespace app\common\model;

class Config extends Common
{

    const UPLOAD_MODES = [
        'local' => '本地保存',
        'oss'   => '阿里云 OSS',
        'qiniu' => '七牛云',
        's3'    => 'S3',
        'cos'   => '腾讯云 COS',
        'obs'   => '华为云 OBS'
    ];

    //写入限制登录ip
    public static function update_prohibit_ip($ip)
    {
        if (empty($ip)) {
            return;
        }
        $data    = self::where(['name' => 'admin_prohibit_ip'])->value('value');
        $dataNew = $data.','.$ip;
        self::where(['name' => 'admin_prohibit_ip'])->data(['value' => $dataNew])->update();
    }

}
